<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');

$description = mysql_real_escape_string(strip_tags($_POST['new_type']));
$building_id = mysql_real_escape_string(strip_tags($_POST['bid']));

echo "<h1>Add Season</h1>";

$result = mysql_query("SELECT * FROM classroom_types");
$num_rows = mysql_numrows($result);

$type_id = $num_rows + 1;

$query2 = "INSERT INTO classroom_types (id, description)
	VALUES ('','$description')";

$result2 = mysql_query($query2);

if ($result2)
{
	echo "<b>$description</b> has been successfully added to classroom types!";
	echo "<br />";
}
else
{
	echo "<b>$description</b> was NOT able to be added to classroom types at this time!";
	echo "<br />";
}

//close
mysql_close();

echo "<p>";
	echo "<a href='index.php?id=$building_id'>&lt;&lt; Back to Classrooms Portal</a><br />";
echo "</p>";
?>

<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>